#include "mythread.h"

myThread::myThread(QTcpSocket *s)
{
    socket = s;
}

void myThread::run()//处理客户端
{
    //子线程任务代码必须放在run函数里面
    connect(socket,&QTcpSocket::readyRead,this,&myThread::clientInfoSlot);
}

//不能在其他类里面操作界面
void myThread::clientInfoSlot()//在主线程里面执行
{
    //接收
    qDebug()<<socket->readAll();

}
